package 算法训练;

/**
 * Created by lenovo on 2017/3/28.
 */
public class q137 {
    public static int x = 0; //记录最大值
    public static int[] flag = new int[43];//辅助数组由题可知10 10 10 9 10 10 8 10 10这样最大的数据所能走的最大距离为43所有下标43够了
    public static int[] N = {0, 1, 2, 3, 4, 5, 6, 7, 8}; //辅助九个动作全排列数组
    public static People[] peoples = new People[3]; //三个角色

    private void swap(int a, int b) {
        int temp = N[a];
        N[a] = N[b];
        N[b] = temp;
    }

    private void judge(int a, int b, int pos) {
        switch (peoples[0].getThrflag() + peoples[1].getThrflag() + peoples[2].getThrflag()) {
            case 1:
                if (peoples[a].getMvflag() == 0) {//如果背人的这个没走过且是第二次丢人
                    x = x > pos + peoples[a].getMvmax() + 1 + peoples[b].getThrmax() ? x : pos + peoples[a].getMvmax() + 1 + peoples[b].getThrmax(); //这里有个比较巧的事情
                }
                break;
            case 2:
                if (peoples[a].getMvflag() == 0) //如果背人的这个没走过且是第三次丢人
                    if (peoples[a].getMvmax() > peoples[a].getThrmax())
                        x = x > pos + peoples[a].getMvmax() ? x : pos + peoples[a].getMvmax();
                if (peoples[b].getMvflag() == 0)
                    x = x > pos + peoples[a].getThrmax() + peoples[b].getMvmax() ? x : pos + peoples[a].getThrmax() + peoples[b].getMvmax();
                break;
        }
    }

    public static void main(String[] args) {

    }

}

class People {
    private int pos;//此人当前所在的位置
    private int flag;//如果flag为0代表没被举 1代表被举了
    private int juren;
    private int mvflag;//移动标志位如果没移动则为0 移动了则为1
    private int mvmax;//移动的最大步数
    private int thrflag;//丢标志位丢过为1没丢过则为0
    private int thrmax;//丢的最大距离

    public int getPos() {
        return pos;
    }

    public void setPos(int pos) {
        this.pos = pos;
    }

    public int getFlag() {
        return flag;
    }

    public void setFlag(int flag) {
        this.flag = flag;
    }

    public int getJuren() {
        return juren;
    }

    public void setJuren(int juren) {
        this.juren = juren;
    }

    public int getMvflag() {
        return mvflag;
    }

    public void setMvflag(int mvflag) {
        this.mvflag = mvflag;
    }

    public int getMvmax() {
        return mvmax;
    }

    public void setMvmax(int mvmax) {
        this.mvmax = mvmax;
    }

    public int getThrflag() {
        return thrflag;
    }

    public void setThrflag(int thrflag) {
        this.thrflag = thrflag;
    }

    public int getThrmax() {
        return thrmax;
    }

    public void setThrmax(int thrmax) {
        this.thrmax = thrmax;
    }
}
